
<%@page import="jobportal.Dbconn"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.Connection"%>
<%@include file="header.jsp" %>
<%
            Connection con = null;
            Statement st = null, st1 = null;
            ResultSet rs = null, rs1 = null;
            int jobseek = 0, constltnt = 0, emplr = 0, compprof = 0, totjobs = 0, actjobseek = 0, inactjobseek = 0;
            int todayjobseek = 0, todayemplr = 0, todaycnsltnt = 0, todayjobs = 0, todaycllglogin = 0, todayjobposted = 0;
            try {
                con = Dbconn.getConn();
                st = con.createStatement();
                st1 = con.createStatement();
                rs = st.executeQuery("select count(*) from student");
                if (rs.next()) {
                    jobseek = rs.getInt(1);
                }
                rs = st.executeQuery("select count(*),type from company group by type");
                while (rs.next()) {
                    if (rs.getString(2).equalsIgnoreCase("Corporate")) {
                        emplr = rs.getInt(1);
                    } else if (rs.getString(2).equalsIgnoreCase("Placement Consultant")) {
                        constltnt = rs.getInt(1);
                    }
                }
                rs = st.executeQuery("select count(*) from company");
                if (rs.next()) {
                    compprof = rs.getInt(1);
                }
                rs = st.executeQuery("select count(*) from jobs");
                if (rs.next()) {
                    totjobs = rs.getInt(1);
                }
                rs = st.executeQuery("select count(*),adminverify from student group by adminverify");
                while (rs.next()) {
                    if (rs.getString(2).equalsIgnoreCase("Active")) {
                        actjobseek = rs.getInt(1);
                    } else {
                        inactjobseek = rs.getInt(1);
                    }
                }
                rs = st.executeQuery("select count(*) from student where lastlogin=curdate()");
                if (rs.next()) {
                    todayjobseek = rs.getInt(1);
                }
                rs = st.executeQuery("select count(*) from college where date(lastlogin)=curdate()");
                if (rs.next()) {
                    todaycllglogin = rs.getInt(1);
                }
                rs = st.executeQuery("select count(*),type from company where date(lastlogin)=curdate() group by type");
                while (rs.next()) {
                    if (rs.getString(2).equalsIgnoreCase("Corporate")) {
                        todayemplr = rs.getInt(1);
                    } else {
                        todaycnsltnt = rs.getInt(1);
                    }

                }
                rs = st.executeQuery("select count(*) from jobs where jobpostdate=curdate()");
                if (rs.next()) {
                    todayjobposted = rs.getInt(1);
                }
            } catch (Exception e) {
                out.println(e);
            }

%>
<body>
    <table class="blnavbg" style="border-top: 1px solid rgb(255, 255, 255); border-bottom: 1px solid rgb(255, 255, 255);" border="0" cellpadding="0" cellspacing="0" width="100%">
        <tbody>


        </tbody>
    </table>
    <table width="100%" border="0" cellspacing="0" cellpadding="0" style="padding-left:2px">
        <tr>
            <td colspan="2">
                <center>


                    <table width="100%" border="0" cellspacing="0" cellpadding="0" style="padding-left:2px">

                    </table>
                </center></td>
        </tr>
        <tr>
            <td align="center" valign="top" style="padding-left:2px; widows:1003px;">
        <style type="text/css">
            <!--
            .style6 {
                color: #FF0000;
                font-weight: bold;
            }
            .style7 {
                color: #006600;
                font-weight: bold;
            }
            -->
        </style>

        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="tbborder">
            <tbody>
                <tr>
                    <td valign="top" style="padding: 10px;"><!-- Starts the content part -->
                        <center>
                            <div align="left" valign="middle" style="width:100%">
                                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="border: 1px solid rgb(169, 211, 225);">
                                                <tr class="bluebg">
                                                    <td height="25" colspan="3" >&nbsp;Site

                                                        Statistics </td>
                                                </tr>
                                                <tr class="bluebg">
                                                    <td colspan="3"class="bluebord"><img src="../images/blank.gif" alt="" border="0" height="1" width="1" /></td>
                                                </tr>


                                                <tr >
                                                    <td height="30" align="right" class="normal">Total

                                                        Employers : </td>
                                                    <td height="30" class="normal" >&nbsp;</td>
                                                    <td height="30" class="normal" ><%=emplr%></td>
                                                </tr>
                                                <tr >
                                                    <td height="30" align="right"  class="normal">Total

                                                        Consultants : </td>
                                                    <td height="30" class="normal" >&nbsp;</td>
                                                    <td height="30" class="normal" ><%=constltnt%></td>
                                                </tr>

                                                <tr >
                                                    <td height="30" align="right"  class="normal">Total

                                                        Company Profiles : </td>
                                                    <td height="30" class="normal" >&nbsp;</td>
                                                    <td height="30" class="normal" ><%=compprof%></td>
                                                </tr>
                                                <tr >
                                                    <td height="30" align="right"  class="normal">Total

                                                        Jobs : </td>
                                                    <td height="30" class="normal" >&nbsp;</td>
                                                    <td height="30" class="normal" ><%=totjobs%></td>
                                                </tr>
                                                <tr >
                                                    <td height="30" align="right"  class="normal">Total

                                                        Jobseeker : </td>
                                                    <td height="30" class="normal" >&nbsp;</td>
                                                    <td height="30" class="normal" ><%=jobseek%> (Active Jobseeker:<span class="style7"><%=actjobseek%></span> | Inactive Resumes:<span class="style6"><%=inactjobseek%></span> ) </td>
                                                </tr>
                                            </table></td>
                                    </tr>
                                    <tr>
                                        <td valign="top">&nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="inset">
                                                <tr>
                                                    <td><table width="100%" align="center" cellpadding="0" cellspacing="0" style="border: 1px solid rgb(169, 211, 225);">
                                                            <tr class="bluebg">
                                                                <td height="28" colspan="6" align="left"  ><span >&nbsp;Recent

                                                                        Statistics</span></td>
                                                            </tr>
                                                            <tr class="bluebg">
                                                                <td colspan="6" align="left" class="bluebord"><img src="../images/blank.gif" alt="" border="0" height="1" width="1" /></td>
                                                            </tr>
                                                            <tr bgcolor="#E4E4E4">
                                                                <td width="17%" height="25" align="right" bgcolor="#E4E4E4"  ></td>
                                                                <td width="16%" align="center" bgcolor="#E4E4E4"  >Jobs

                                                                    Posted </td>
                                                                <td width="18%" align="center" bgcolor="#E4E4E4"  >Clooege Login </td>
                                                                <td width="17%" height="25" align="center" bgcolor="#E4E4E4"  >Employer Login</td>
                                                                <td width="17%" height="25" align="center" bgcolor="#E4E4E4"  >Consultants Login</td>
                                                                <td width="15%" align="center" bgcolor="#E4E4E4"  >Student Login</td>
                                                            </tr>
                                                            <tr >
                                                                
                                                                <td height="25" align="right" class="normal">Today  : </td>
                                                                <td align="center" class="normal" ><%=todayjobposted%></td>
                                                                <td align="center" class="normal" ><%=todaycllglogin %></td>
                                                                <td height="25" align="center" class="normal" ><%=todayemplr%></td>
                                                                <td height="25" align="center" class="normal" ><%=todaycnsltnt%></td>
                                                                <td height="25" align="center" class="normal" ><%=todayjobseek%></td>
                                                            </tr>
                                                        </table></td>
                                                </tr>
                                            </table></td>
                                    </tr>
                                </table>
                            </div>
                        </center>
                        <br /></td>
                </tr>
            </tbody>
        </table>
    </td>
</tr>
<tr>
    <td height="337" colspan="2">&nbsp;</td>
</tr>
<tr>
    <td colspan="2"><style type="text/css">
    <!--
    .style1 {font-size: xx-small}
    -->
</style>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tbody><tr><td><DIV class="GrayTxt SmFont PadFive" align=right><span class="style1"></span><BR>
                </DIV>
            </td></tr>
        <tr>
            <td>&nbsp;</td>
        </tr>
    </tbody></table>
<%@include file="footer.jsp" %>